
//
//  PurchasingInformationViewController.m
//  HAODE
//
//  Created by panquanReabam.com on 15/9/14.
//  Copyright (c) 2015年 reabam.com. All rights reserved.
//
#import "ProposalDetailViewController.h"
#import "RDVTabBarController.h"
#import "RepairCell.h"
#import "Repairmodel.h"
#import "UIImageView+WebCache.h"

#import "HttpRequest.h"
#import "TheLoginViewController.h"
#import "HAODEsingleton.h"
#import "addRepairViewController.h"
#import "imageview.h"
#import "addRepairViewController.h"
@interface ProposalDetailViewController ()<UIScrollViewDelegate,UIGestureRecognizerDelegate,UINavigationControllerDelegate>
@property (strong, nonatomic)UITableView *tableView;
@property (nonatomic, strong) UIImageView * allImageBtn;
@property(nonatomic,strong)NSString*sta;
@end

@implementation ProposalDetailViewController{
    int index;
    NSString * hasNext;
    NSString *nextIndex;
    NSMutableArray *allComment;
    NSMutableArray *amt;
    NSMutableArray *detail;
    NSMutableArray *provinceName;
    NSMutableArray *cityName;
    NSMutableArray *status;
    NSMutableArray*imageUrlFull;
    NSMutableArray *time;
    NSMutableArray *reqId;
    NSMutableArray *address;
    NSMutableArray *userName;
    HAODEsingleton*commdity;
    UIButton*sat;
    UIButton*sat1;
    UIButton*sxuan;
    int tapImageCount;
    UIScrollView*MYmainScroll;
    NSMutableArray*arr;
    imageview*imageView;
    UIView*view;
    UIButton*i22;
    UIButton*i1;
    UIButton*i12;
    NSDictionary*dic;
}
@synthesize alt = alt;
- (void)viewDidDisappear:(BOOL)animated

{
    
    [super viewDidDisappear:animated];
    
    
    
    self.navigationController.delegate = nil;
    
}
-(void)BackAction:(UIButton *)sender{
    
    [self.navigationController popViewControllerAnimated:YES];
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    self.navigationController.delegate = self;
    
    self.navigationController.interactivePopGestureRecognizer.delegate = self;
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@""] forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage =[[UIImage alloc] init];
    
    [[self rdv_tabBarController] setTabBarHidden:YES];
    self.navigationController.navigationBarHidden = NO;
        self.navigationController.navigationBar.barStyle = UIBaselineAdjustmentNone;
    UILabel *lineLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 43,ScreenWidth, 1)];
    [lineLabel setBackgroundColor:[UIColor colorWithRed:238.0/255.0 green:238.0/255.0 blue:238.0/255.0 alpha:1.0]];
    [self.navigationController.navigationBar addSubview:lineLabel];
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    [[UINavigationBar appearance] setBarTintColor:Color];
    
    UIImage* backImage = [UIImage imageNamed:@"fanhui"];
    CGRect backframe = CGRectMake(0,0,30,30);
    UIButton* backButton= [[UIButton alloc] initWithFrame:backframe];
    [backButton setBackgroundImage:backImage forState:UIControlStateNormal];
    backButton.titleLabel.textAlignment=NSTextAlignmentLeft;
    [backButton addTarget:self action:@selector(BackAction:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem* leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
    self.navigationItem.leftBarButtonItem = leftBarButtonItem;
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@""] forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage =[[UIImage alloc] init];
    
    [self setup];
    
}


- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"投诉建议详情";
    commdity=[HAODEsingleton shared];
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                                     backColor,
                                                                     UITextAttributeTextColor,
                                                                     [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1],
                                                                     UITextAttributeTextShadowColor,
                                                                     [NSValue valueWithUIOffset:UIOffsetMake(0, 0)],
                                                                     UITextAttributeTextShadowOffset,
                                                                     [UIFont fontWithName:@"Helvetica Neue" size:tetlefot],
                                                                     UITextAttributeFont,nil]];
    
    
    
    
    
    UIButton*sxBtn = [[UIButton alloc] initWithFrame:CGRectMake(30, 0.0,  60/2, 60/2)];
    [sxBtn setTitle:@"..." forState:UIControlStateNormal];
     sxBtn.titleLabel.font=[UIFont systemFontOfSize:28];
    [sxBtn setTitleColor:luseColor forState:UIControlStateNormal];
    [sxBtn addTarget:self action:@selector(xuanze:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem* myBtnBtn = [[UIBarButtonItem alloc] initWithCustomView:sxBtn];
    self.navigationItem.rightBarButtonItem = myBtnBtn;
    
    
}

- (void)setup{
    
    amt=[[NSMutableArray alloc]init];
    detail=[[NSMutableArray alloc]init];
    provinceName=[[NSMutableArray alloc]init];
    status=[[NSMutableArray alloc]init];
    time=[[NSMutableArray alloc]init];
    reqId=[[NSMutableArray alloc]init];
    address=[[NSMutableArray alloc]init];
    userName=[[NSMutableArray alloc]init];
    cityName=[[NSMutableArray alloc]init];
    imageUrlFull=[[NSMutableArray alloc]init];
    
    NSUserDefaults *user1 = [NSUserDefaults standardUserDefaults];
    NSString* tokenId = [user1 objectForKey:@"tokenId"];
    NSMutableDictionary *params = [NSMutableDictionary new];
    [params setValue:tokenId forKey:@"tokenId"];
    [params setValue:commdity.orderId forKey:@"demandId"];
    
    NSLog(@"-----%@",params);
    [Global showIndeterminateHudSub:@"加载中，请稍后。。。" delay:20 view:self.view];
    [HttpRequest requestData:@"/Estate/Demand/Proposal/Detail" params:params success:^(BOOL isSuccess, SeverData *severDataDict) {
        if (isSuccess) {
            
            NSLog(@"-----%@",severDataDict.dataDict);
            
            if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==0) {
                [Global hideProgressHUDInternal:self.view];
                dic=severDataDict.dataDict;
                arr=[severDataDict.dataDict objectForKey:@"images"];
                
                MYmainScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0,64, ScreenWidth, ScreenHeight)];
                [MYmainScroll setBackgroundColor: zuiqianhuicolor];
                
                MYmainScroll.delegate = self;
                MYmainScroll.userInteractionEnabled = YES;
                MYmainScroll.scrollEnabled = YES;
                MYmainScroll.showsVerticalScrollIndicator = FALSE;
                MYmainScroll.showsHorizontalScrollIndicator = FALSE;
                [self.view addSubview:MYmainScroll];
                
                
                view=[[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 250)];
                view.backgroundColor=[UIColor whiteColor];
                [MYmainScroll addSubview:view];
                UILabel *line=[[UILabel alloc]initWithFrame:CGRectMake(15, 50, ScreenWidth-30, 0.35)];
                line.backgroundColor=qianhuicolor;
                [MYmainScroll addSubview:line];
                
                UILabel*title=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, 200, 50)];
                title.text=[severDataDict.dataDict objectForKey:@"typeName"];
                title.textColor=[UIColor blackColor];
                [MYmainScroll addSubview:title];
                
                UILabel*statuslabel=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-150, 0, 130, 50)];
                
                statuslabel.textAlignment=NSTextAlignmentRight;
                if ([[severDataDict.dataDict objectForKey:@"status"] isEqualToString:@"C"]) {
                    statuslabel.text=@"已取消";
                    statuslabel.textColor=zhonghuiColor;
                }
                if ([[severDataDict.dataDict objectForKey:@"status"] isEqualToString:@"Y"]) {
                    statuslabel.text=@"已处理";
                    statuslabel.textColor=luseColor;
                }
                if ([[severDataDict.dataDict objectForKey:@"status"] isEqualToString:@"B"]) {
                    statuslabel.text=@"处理中";
                    statuslabel.textColor=luseColor;
                }
                if ([[severDataDict.dataDict objectForKey:@"status"] isEqualToString:@"N"]) {
                    statuslabel.text=@"未处理";
                    statuslabel.textColor=hongsecolor;
                }
                [MYmainScroll addSubview:statuslabel];
                
                
                NSString *s = [NSString stringWithFormat:@"%@", [severDataDict.dataDict objectForKey:@"details"]];
                UIFont *font = [UIFont systemFontOfSize:16];
                CGSize size = CGSizeMake(ScreenWidth-40, 2000);
                CGSize labelsize = [s sizeWithFont:font constrainedToSize:size lineBreakMode:NSLineBreakByCharWrapping];
                UILabel*details=[[UILabel alloc]initWithFrame:CGRectMake(15, 60, ScreenWidth-40, labelsize.height+5)];
                details.text=s;
                details.numberOfLines=0;
                details.textColor=shenhuicolor;
                details.font=[UIFont systemFontOfSize:16];
                [view addSubview:details];
                
                if (arr.count>0) {
                    
                    for (int i = 0,j = -1; i < arr.count; i++) {
                        if (i%4 == 0) {
                            j++;
                        }
                        
                        
                        imageView  = [[imageview alloc]initWithFrame:CGRectMake(15+(ScreenWidth-30)/4*(i%4), details.bottom+20+(ScreenWidth-30)/4*j, (ScreenWidth-50)/4, (ScreenWidth-50)/4)];
                        
                        [imageView.buttonViewimage setImageWithURL:[NSURL URLWithString:[[arr objectAtIndex:i] objectForKey:@"imageUrlFull"]] placeholderImage:[UIImage imageNamed:nil]];
                        //
                        //
                        [view addSubview:imageView];
                        
                        
                    }
                     view.frame=CGRectMake(0, 0, ScreenWidth, imageView.bottom+50);
                    UILabel*createTime=[[UILabel alloc]initWithFrame:CGRectMake(15, imageView.bottom, 200, 50)];
                    createTime.text=[severDataDict.dataDict objectForKey:@"createTime"];
                    createTime.textColor=zhonghuiColor;
                    createTime.font=[UIFont systemFontOfSize:13];
                    [view addSubview:createTime];

                }else{
                
                 view.frame=CGRectMake(0, 0, ScreenWidth,250);
                    UILabel*createTime=[[UILabel alloc]initWithFrame:CGRectMake(15, 200, 200, 50)];
                    createTime.text=[severDataDict.dataDict objectForKey:@"createTime"];
                    createTime.textColor=zhonghuiColor;
                    createTime.font=[UIFont systemFontOfSize:13];
                    [view addSubview:createTime];

                }
                
               
                
                
                
                MYmainScroll.contentSize = CGSizeMake(ScreenWidth,  view.bottom+300);
                
                
                
                
                
                
                
            }else{
                
                
                NSString *requestResultStr=[severDataDict.dataDict objectForKey:@"ResultString"];
                [Global showTextHudSub:requestResultStr view:self.view];
                
                
                if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==9999) {
                    
                    TheLoginViewController*detailViewController = [[TheLoginViewController alloc] init];
                    
                    [self.navigationController pushViewController:detailViewController animated:YES];
                    
                }
                
            }
            
        }
        else
        {
            [Global hideProgressHUDInternal:self.view];
            
            [Global showTextHudSub:@"连接失败" view:self.view];
        }
        
    }];
    
    
    
}

//- (void)setupCouponCommentView:(NSDictionary *)dic{
//
//    NSMutableArray *commentArray = [dic objectForKey:@"DataLine"];
//    allComment = [NSMutableArray array];
//    for (int i = 0; i<commentArray.count; i++) {
//
//        NSMutableDictionary *dataDic = commentArray[i];
//        if (![dataDic isKindOfClass:[NSNull class]]){
//
//            NSArray *commentPicArray = [dataDic objectForKey:@"images"];
//
//
//            Repairmodel *cModel = [[Repairmodel alloc]init];
//
//            cModel.userName = [dataDic objectForKey:@"typeName"];
//            cModel.details = [dataDic objectForKey:@"details"];
//            cModel.baojiaSat = [dataDic objectForKey:@"status"];
//            cModel.createTime = [dataDic objectForKey:@"createTime"];
//            cModel.status = [dataDic objectForKey:@"status"];
//            NSMutableArray *fakeCommentImagesSmall = [NSMutableArray array];
//            NSMutableArray *fakeCommentImagesBig = [NSMutableArray array];
//            for (NSDictionary *picDic in commentPicArray) {
//                [fakeCommentImagesSmall addObject:[picDic objectForKey:@"imageUrlFull"]];
//                [fakeCommentImagesBig addObject:[picDic objectForKey:@"imageUrlFull"]];
//            }
//            cModel.imagePicSmall = fakeCommentImagesSmall;
//            cModel.imagePicBig = fakeCommentImagesBig;
//            [allComment addObject:cModel];
//        }
//    }
//    [self.view addSubview:self.tableView];
//    [self.tableView reloadData];
//}
//
//
//
//#pragma mark - TableView dataSource && delegate
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
//{
//    return allComment.count;
//}
//
//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
//{
//
//    //UITableViewCell *cell = [self tableView:_tableView cellForRowAtIndexPath:indexPath];
//    //    return cell.frame.size.height;
//    return [RepairCell cellHeight:allComment[indexPath.row]]+20;
//}
//
//
//
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
//{
//
//    static NSString *identifier = @"RepairCell";
//    RepairCell *cell = (RepairCell *)[tableView dequeueReusableCellWithIdentifier:identifier];
//    if (cell == nil) {
//        cell = [[NSBundle mainBundle] loadNibNamed:@"RepairCell" owner:self options:nil][0];
//    }
//
//    cell.selectionStyle = UITableViewCellSelectionStyleNone;
//    Repairmodel *obj = allComment[indexPath.row];
//    cell.comment = obj;
//
//
//
//
//
//
//    return cell;
//}
//
//-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//
//
//
//    commdity.reqId=reqId[indexPath.row];
//
//    //    commdity.status=status[indexPath.row];
//    RepairDetailViewController* store=[[RepairDetailViewController alloc]init];
//
//    [self.navigationController pushViewController:store animated:YES];
//
//
//}


-(void)xuanze:(UIButton*)sender{
    
    [i12 removeFromSuperview];
    [i22 removeFromSuperview];
    [i1 removeFromSuperview];
    
    if ([[dic objectForKey:@"status"] isEqualToString:@"C"]) {
        i1=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth*470/750, 0,ScreenWidth*140/750, 220*ScreenHeight/1334)];
        i1.backgroundColor=[UIColor colorWithRed:90/255.0 green:130/255.0 blue:26/255.0 alpha:1.0];
        [i1 setTitleColor:zhonghuiColor forState:UIControlStateNormal];
        i1.titleLabel.font=[UIFont systemFontOfSize:contenfot];
        [i1 addTarget:self action:@selector(cui1:) forControlEvents:UIControlEventTouchUpInside];
        [i1 setTitle:@"催促跟进" forState:UIControlStateNormal];
        [MYmainScroll addSubview:i1];
        
        i12=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth*610/750, 0, ScreenWidth*140/750, 220*ScreenHeight/1334)];
        i12.backgroundColor=[UIColor colorWithRed:90/255.0 green:130/255.0 blue:26/255.0 alpha:1.0];
        [i12 setTitleColor:zhonghuiColor forState:UIControlStateNormal];
        i12.titleLabel.font=[UIFont systemFontOfSize:contenfot];
        [i12 addTarget:self action:@selector(cui1:) forControlEvents:UIControlEventTouchUpInside];
        [i12 setTitle:@"取消问题" forState:UIControlStateNormal];
        [MYmainScroll addSubview:i12];
        
        
    }else{
        
        i1=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth*470/750, 0,ScreenWidth*140/750, 220*ScreenHeight/1334)];
        i1.backgroundColor=[UIColor colorWithRed:90/255.0 green:130/255.0 blue:26/255.0 alpha:1.0];
        [i1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        i1.titleLabel.font=[UIFont systemFontOfSize:contenfot];
        [i1 addTarget:self action:@selector(cui:) forControlEvents:UIControlEventTouchUpInside];
        [i1 setTitle:@"催促跟进" forState:UIControlStateNormal];
        [MYmainScroll addSubview:i1];
        
        i12=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth*610/750, 0, ScreenWidth*140/750, 220*ScreenHeight/1334)];
        i12.backgroundColor=[UIColor colorWithRed:90/255.0 green:130/255.0 blue:26/255.0 alpha:1.0];
        [i12 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        i12.titleLabel.font=[UIFont systemFontOfSize:contenfot];
        [i12 addTarget:self action:@selector(quxiao:) forControlEvents:UIControlEventTouchUpInside];
        [i12 setTitle:@"取消问题" forState:UIControlStateNormal];
        [MYmainScroll addSubview:i12];
    }

//    i1=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth*470/750, 0,ScreenWidth*140/750, 220*ScreenHeight/1334)];
//    i1.backgroundColor=[UIColor colorWithRed:90/255.0 green:130/255.0 blue:26/255.0 alpha:1.0];
//    [i1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    i1.titleLabel.font=[UIFont systemFontOfSize:contenfot];
//    [i1 addTarget:self action:@selector(cui:) forControlEvents:UIControlEventTouchUpInside];
//    [i1 setTitle:@"催促跟进" forState:UIControlStateNormal];
//    [MYmainScroll addSubview:i1];
//    
//    i12=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth*610/750, 0, ScreenWidth*140/750, 220*ScreenHeight/1334)];
//    i12.backgroundColor=[UIColor colorWithRed:90/255.0 green:130/255.0 blue:26/255.0 alpha:1.0];
//    [i12 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    i12.titleLabel.font=[UIFont systemFontOfSize:contenfot];
//    [i12 addTarget:self action:@selector(quxiao:) forControlEvents:UIControlEventTouchUpInside];
//    [i12 setTitle:@"取消问题" forState:UIControlStateNormal];
//    [MYmainScroll addSubview:i12];
    
}
-(void)cui1:(UIButton*)sender{
    [i12 removeFromSuperview];
    [i22 removeFromSuperview];
    [i1 removeFromSuperview];
}

-(void)cui:(UIButton*)sender{
    [i12 removeFromSuperview];
    [i22 removeFromSuperview];
    [i1 removeFromSuperview];
    
    //    UIAlertView* alt1 = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"是否确认注销？" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil];
    //     alt1.tag=1;
    //    [alt1 show];
    NSUserDefaults *user1 = [NSUserDefaults standardUserDefaults];
    NSString* tokenId = [user1 objectForKey:@"tokenId"];
    NSMutableDictionary *params = [NSMutableDictionary new];
    [params setValue:tokenId forKey:@"tokenId"];
    [params setValue:commdity.orderId forKey:@"demandId"];
    
    NSLog(@"-----%@",params);
    [Global showIndeterminateHudSub:@"加载中，请稍后。。。" delay:20 view:self.view];
    [HttpRequest requestData:@"/Estate/Demand/Proposal/Urge" params:params success:^(BOOL isSuccess, SeverData *severDataDict) {
        if (isSuccess) {
            
            NSLog(@"-----%@",severDataDict.dataDict);
            
            if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==0) {
                [Global hideProgressHUDInternal:self.view];
                
                [self.navigationController popViewControllerAnimated:YES];
                
                
                
                
                
            }else{
                
                
                NSString *requestResultStr=[severDataDict.dataDict objectForKey:@"ResultString"];
                [Global showTextHudSub:requestResultStr view:self.view];
                
                
                if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==9999) {
                    
                    TheLoginViewController*detailViewController = [[TheLoginViewController alloc] init];
                    
                    [self.navigationController pushViewController:detailViewController animated:YES];
                    
                }
                
            }
            
        }
        else
        {
            [Global hideProgressHUDInternal:self.view];
            
            [Global showTextHudSub:@"连接失败" view:self.view];
        }
        
    }];
    
    
    
    
    
}
-(void)quxiao:(UIButton*)sender{
    [i12 removeFromSuperview];
    [i22 removeFromSuperview];
    [i1 removeFromSuperview];
    
    UIAlertView* alt1 = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"是否确认取消！" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确认", nil];
    alt1.tag=0;
    [alt1 show];
    
    
    
    
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    
    if (buttonIndex == 1) {
        
        
        NSUserDefaults *user1 = [NSUserDefaults standardUserDefaults];
        NSString* tokenId = [user1 objectForKey:@"tokenId"];
        NSMutableDictionary *params = [NSMutableDictionary new];
        [params setValue:tokenId forKey:@"tokenId"];
        [params setValue:commdity.orderId forKey:@"demandId"];
        
        NSLog(@"-----%@",params);
        [Global showIndeterminateHudSub:@"加载中，请稍后。。。" delay:20 view:self.view];
        [HttpRequest requestData:@"/Estate/Demand/Proposal/Cancel" params:params success:^(BOOL isSuccess, SeverData *severDataDict) {
            if (isSuccess) {
                
                NSLog(@"-----%@",severDataDict.dataDict);
                
                if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==0) {
                    [Global hideProgressHUDInternal:self.view];
                    
                    [self.navigationController popViewControllerAnimated:YES];
           
                }else{
                    
                    
                    NSString *requestResultStr=[severDataDict.dataDict objectForKey:@"ResultString"];
                    [Global showTextHudSub:requestResultStr view:self.view];
                    
                    
                    if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==9999) {
                        
                        TheLoginViewController*detailViewController = [[TheLoginViewController alloc] init];
                        
                        [self.navigationController pushViewController:detailViewController animated:YES];
                        
                    }
                    
                }
                
            }
            else
            {
                [Global hideProgressHUDInternal:self.view];
                
                [Global showTextHudSub:@"连接失败" view:self.view];
            }
            
        }];
        
        
        
    }
    
}

-(void)closeKeyBoad
{
    
    [i12 removeFromSuperview];
    [i22 removeFromSuperview];
    [i1 removeFromSuperview];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void)showAlertWait
{
    alt = [[UIAlertView alloc] initWithTitle:@"网络不稳定哦 ！" message:@"请确认网络" delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
    [alt show];
    
    [self performSelector:@selector(hideAlert) withObject:nil afterDelay:1.0f];
    
}

- (void)showAlertMessage:(NSString *)msg
{
    alt = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:msg delegate:nil cancelButtonTitle:nil otherButtonTitles: nil];
    [alt show];
    
    [self performSelector:@selector(hideAlert) withObject:nil afterDelay:1.0f];
}
- (void)hideAlert
{
    if (alt != nil)
    {
        [alt dismissWithClickedButtonIndex:0 animated:YES];
        alt = nil;
    }
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
